#include <stdio.h>  
#include <stdlib.h>  
  
// 定义矩阵结构体  
typedef struct {  
    int rows;       // 矩阵行数  
    int cols;       // 矩阵列数  
    int data[100][100];    // 存储矩阵元素的数组  
} SparseMatrix;  
  
// 创建稀疏矩阵  
SparseMatrix* createSparseMatrix(int rows, int cols) {  
    SparseMatrix* mat = (SparseMatrix*)malloc(sizeof(SparseMatrix));  
    mat->rows = rows;  
    mat->cols = cols;  
    for (int i = 0; i < rows; i++) {  
        for (int j = 0; j < cols; j++) {  
            mat->data[i][j] = 0;  
        }  
    }  
    return mat;  
}  
  
// 打印稀疏矩阵  
void printSparseMatrix(SparseMatrix* mat) {  
    printf("Matrix:\n");  
    for (int i = 0; i < mat->rows; i++) {  
        for (int j = 0; j < mat->cols; j++) {  
            printf("%d ", mat->data[i][j]);  
        }  
        printf("\n");  
    }  
}  
  
// 稀疏矩阵乘法运算  
SparseMatrix* multiplySparseMatrix(SparseMatrix* mat1, SparseMatrix* mat2) {  
    SparseMatrix* result = createSparseMatrix(mat1->rows, mat2->cols);  
    for (int i = 0; i < mat1->rows; i++) {  
        for (int j = 0; j < mat2->cols; j++) {  
            for (int k = 0; k < mat1->cols; k++) {  
                result->data[i][j] += mat1->data[i][k] * mat2->data[k][j];  
            }  
        }  
    }  
    return result;  
}  
  
int main() {  
    // 创建两个稀疏矩阵A和B  
    SparseMatrix* A = createSparseMatrix(3, 4);  
    SparseMatrix* B = createSparseMatrix(4, 3);  
    // 设置矩阵元素的值  
    A->data[0][0] = 1; A->data[0][2] = 2; A->data[1][1] = 3; A->data[2][0] = 4; A->data[2][2] = 5;  
    B->data[0][0] = 6; B->data[1][0] = 7; B->data[2][1] = 8; B->data[2][2] = 9; B->data[2][0] = 10; B->data[1][2] = 11; B->data[0][1] = 12; B->data[0][2] = 13; B->data[0][0] = 14; B->data[1][1] = 15; B->data[1][2] = 16; B->data[2][2] = 17; B->data[2][3] = 18; B->data[3][2] = 19; B->data[3][3] = 20; B->data[3][0] = 21; B->data[3][1] = -3956849784755795544; B->data[3][3] = -3956849784755795544; B->data[3][2] = -3956849784755795544; B->data[3][0] = -3956849784755795544; B->data[3][1] = -3956849784755795544; B->data[2][3] = -3956849784755795544; B->data[2][2] = -3956849784755795544; B->data[2][0] = -